#ifndef __QOUTE_INL__
#define __QOUTE_INL__

//////////////////////////////////////////////////////////////////////////
inline QUOTE::QUOTE( void )
: newPrice( NAN_PRICE )
, bidPrice( NAN_PRICE )
, askPrice( NAN_PRICE )
{}

inline QUOTE::QUOTE( const PRICE& newp, const PRICE& bidp, const PRICE& askp )
: newPrice( newp )
, bidPrice( bidp )
, askPrice( askp )
{
}

inline bool QUOTE::IsValid( void ) const
{
	return ( newPrice != NAN_PRICE
		&& bidPrice != NAN_PRICE
		&& askPrice != NAN_PRICE );
}

inline QUOTE QUOTE::QuoteViaMode( QUOTE_MODE mode ) const
{
	switch( mode )
	{
	case QTYPE_USE_ALL:
		{
			return *this;
		}
	case QTYPE_USE_BID:
		{
			return QUOTE( bidPrice, bidPrice, bidPrice );
		}
	case QTYPE_USE_ASK:
		{
			return QUOTE( askPrice, askPrice, askPrice );
		}
	case QTYPE_USE_NEW:
		{
			return QUOTE( newPrice, newPrice, newPrice );
		}
	case QTYPE_USE_AVG:
		{
			PRICE price = (bidPrice + askPrice )/2;
			return QUOTE( price, price, price );
		}
	default:
		{
			assert( false );
			return QUOTE();
		}
	}
}

#endif